package twoDimensionArr;

public class TwoDimensionArr2 {
	public static void main(String[] args) {
		int a[][]={{4,4,34,37},{3,12,2,6},{5,17,9,11}};
		sum(a);
		max(a);
		min(a);
		System.out.println(a);
		System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
	}

	private static void min(int[][] a) {
		int min=a[0][0];
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				min=min<a[i][j]?min:a[i][j];
			}
		}
		System.out.println(min);
		
	}

	private static void max(int[][] a) {
        int max=0;
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				max=max>a[i][j]?max:a[i][j];
			}
		}
		System.out.println(max);
	}

	private static void sum(int[][] a) {
		int sum=0;
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				sum+=a[i][j];
			}
		}
		System.out.println(sum);
	}

}
